/**
 * 
 */
package com.hexacta.hrs.repositories.feedback;

import java.util.Collection;
import java.util.List;

import org.vectrics.employee.Employee;
import org.vectrics.user.Person;

import com.hexacta.hrs.domain.feedback.Feedback;
import com.hexacta.hrs.domain.feedback.FeedbackMotive;
import com.hexacta.hrs.domain.feedback.FeedbackPeriod;
import com.hexacta.hrs.domain.feedback.FeedbackPeriodMentorReport;
import com.hexacta.hrs.domain.feedback.FeedbackPeriodResume;
import com.hexacta.hrs.domain.feedback.FeedbackPeriodResumeByRole;
import com.hexacta.hrs.domain.feedback.Period;
import com.hexacta.hrs.repositories.RecordObjectRepository;

/**
 * @author gvilla
 * 
 */
public interface FeedbackPeriodRepository extends RecordObjectRepository<FeedbackPeriod> {

    List<FeedbackPeriod> findByEmployee(final Employee employee);

    // List<FeedbackPeriod> findByRole(final JobFunction role);

    List<FeedbackPeriodResume> getFeedbackPeriodResumes();

    List<FeedbackPeriodResumeByRole> getFeedbackPeriodResumeByRole(String period);

    boolean existFeedbackPeriodForPeriod(String period);

    // List<FeedbackPeriod> findOpenFeedbacks(String role);

    List<FeedbackPeriod> findOpenFeedbacks(final String role, Period period);

    // List<FeedbackPeriod> findClosedPeriods(String role);

    List<FeedbackPeriod> findClosedPeriods(final String role, Period period);

    // List<FeedbackPeriodRole> getFeedbacksPeriodsRole(List<JobFunction>
    // listFunction, String period);

    boolean updateClosedFeedbackPeriod(List<FeedbackPeriod> feedbackPeriodList, boolean closed);

    // String getOpenPeriod();

    // /**
    // * Busca todos los feedbackPeriods que tengan propiedades que matcheen los
    // * par�metros.
    // *
    // * @param evaluated
    // * @param role
    // * @param mentor
    // * @return los feedbacks que matcheen los par�metros
    // */
    // public Collection<FeedbackPeriod> findWith(Employee evaluated,
    // JobFunction role, Employee mentor);

    /**
     * @param Feedback
     *            feedback
     * 
     * @return FeedbackPeriod
     * 
     *         Encuentra y devuelve el feedbackPeriod correspondiente al
     *         feedback enviado por parametro.
     */
    public FeedbackPeriod findWithFeedback(Feedback feedback);

    /**
     * @param jobFunctionWeightCurrentUser
     * @param employeeId
     * @param roleId
     * @param mentorId
     * @return
     */
    Collection<FeedbackPeriod> findFeedbackPeriodsWithCriteria(Period period, Integer jobFunctionWeightCurrentUser,
            Long employeeId, String roleId, Long mentorId);

    public FeedbackPeriod createFeedbackPeriodManually(Employee evaluated, Employee evaluator, String project,
            String motive, FeedbackMotive feedbackMotive, Period period, Integer monthsInProject);

    public Collection<FeedbackPeriodMentorReport> getMentorsReport(Person mentor, String period);

    public List<FeedbackPeriod> findAllFeedbackPeriodsForPeriod(final Period period);
}
